﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EECMISWS
{
    /// <summary>
    /// 预约签注信息
    /// </summary>
    public class AppointmentQZInfo
    {
        /// <summary>
        /// 序号
        /// </summary>
        public string xh { get; set; }
        /// <summary>
        /// 业务编号
        /// </summary>
        public string ywbh { get; set; }
        /// <summary>
        /// 填表单位编号
        /// </summary>
        public string tbdwbh { get; set; }
        /// <summary>
        ///  签注有效次数
        /// </summary>
        public string qzyxcs { get; set; }
        /// <summary>
        /// 签注有效期
        /// </summary>
        public string qzyxq { get; set; }
        /// <summary>
        /// 签注有效期单位
        /// </summary>
        public string qzyxqdw { get; set; }
        /// <summary>
        /// 前往地
        /// </summary>
        public string qwd { get; set; }
        /// <summary>
        /// 签注种类
        /// </summary>
        public string qzzl { get; set; }
        /// <summary>
        /// 签注办理ID       
        /// </summary>
        public string qzblId { get; set; }  

        public bool IsValid
        {
            get
            {
                if (string.IsNullOrEmpty(qwd)
                    || string.IsNullOrEmpty(ywbh)
                    || string.IsNullOrEmpty(qzzl)
                    || string.IsNullOrEmpty(qzyxcs)
                    || string.IsNullOrEmpty(qzyxq))
                {
                    return false;
                }
                if (qwd != "HKG" && qwd != "MAC" && qwd != "TWN")
                {
                    return false;
                }                
                return true;
            }
        }

        public string GetYXQXCode()
        {
            string code = "";
            if(qzyxqdw == "年")
            {
                code = "N" + qzyxq.PadLeft(2, '0');              
            }
            else if (qzyxqdw == "月")
            {
                code = "Y" + qzyxq.PadLeft(2, '0');
            }
            return code;
        }
    }
}
